%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[{kernel, 
    [{start_timer, true},
     {start_pg2, true}
 ]},
 {sasl, [
    {sasl_error_logger, {file, "log/ham_server_sasl.log"}}
 ]},
 {mnesia, [
    {dir, "data"}
 ]},
 {ssl, [
    %{versions, ['tlsv1.2', 'tlsv1.1']}
 ]},
  
 {apns, [
      {apple_host, "gateway.sandbox.push.apple.com"},
      {apple_port, 2195},
      {cert_file, "rel/files/apns.pem"},
      {key_file,  undefined},
      {cert_password, "1234"},
      {timeout, 30000},
      {expires_conn, 300},
      {feedback_port, 2196},
      {feedback_host, "feedback.sandbox.push.apple.com"},
      {feedback_timeout, 5000000}
  ]},

 {lager, [
    {killer_hwm, 30000},
    {killer_reinstall_after, 5000},
    {error_logger_redirect, false},
    {crash_log, "log/ham_server_crash.log"},
    {handlers, [
        {lager_console_backend, debug},
        {lager_file_backend, [
            {file, "log/ham_server_error.log"},
            {level, error},
            {size, 10485760},
            {date, "$D0"},
            {count, 10}
        ]},
        {lager_file_backend, [
            {file, "log/ham_server_info.log"},
            {level, info},
            {size, 10485760},
            {date, "$D0"},
            {count, 10}
        ]},
        {lager_file_backend, [
            {file, "log/ham_server_debug.log"},
            {level, debug},
            {size, 10485760},
            {date, "$D0"},
            {count, 10}
        ]}
    ]}
 ]},
 {esockd, [
    {logger, {lager, debug}}
 ]},
 {mochiweb,[
    {datalimit,     2048000}
 ]},

 {mcast,
   [
         {mcast_max_queue_size,          1000000},     % cast 队列最大的容量
         {package_size,                  1000},        % 每次批量cast的消息量
         {force_gc,                      120000},      % 强制gc的时间间隔
         {loop_interval,                 5}            % 每次cast消息的时间间隔(ms)。
 ]},


 {ham_server, [
    {maintain_cert_file, "rel/files/maintain.pem"},
    {maintain_password,  "1234"},

    {emqttd,'im_server@127.0.0.1'},
    
    % url 后台回调的地址
    {call_back_url, "http://blog.chinaunix.net/uid-27788416-id-3534779.html"},

    {listen, [
        {http, 8184, [
          {acceptors, 160},
          {max_clients, 102400}
        ]},
        {https, 8183, [
          {acceptors, 160},
          {max_clients, 102400},
          {ssl, [
            {certfile, "rel/files/ssl/ssl.crt"},
            {keyfile,  "rel/files/ssl/ssl.key"}]}
        ]}
    ]},

    {emysql, [
        [
            {username, "root"},
            {password, "mingyiyi"},
            {host,     "127.0.0.1"},
            {port,     3306},
            {database, "log_db"},
            {encoding, utf8},
            {pools,    [{log_db, 5}]
            }
        ],

        [   {username, "root"},
            {password, "mingyiyi"},
            {host,     "127.0.0.1"},
            {port,     3306},
            {database, "im_off_db"},
            {encoding, utf8},
            {pools,    [{im_db, 5}]}
        ]
     ]}
 ]}
].

